
import request from '@/utils/request'


const api_name="/admin/system/sysRole";


// 保存分配菜单
export const DoAssignMenuIdToSysRole = (assignMenuDto) => {
  return request({
    url: `/admin/system/sysRoleMenu/doAssign`,
    method: 'post',
    data:assignMenuDto

  })
}


// 获取所有菜单和当前用户原来的菜单id集合
export const GetSysRoleMenuIds = (roleId) => {
  return request({
    url: `/admin/system/sysRoleMenu/findSysRoleMenuByRoleId/${roleId}`,
    method: 'get',

  })
}




// 获取所有角色和当前用户原来的角色id集合
export const GetAllRoleList = (userId) => {
  return request({
    url: `${api_name}/findAllRoles/${userId}`,
    method: 'get',

  })
}



//删除角色
export const DeleteSysRoleById=roleId=>{

  return request({
    url: `${api_name}/deleteSysRoleById/${roleId}`,
    method: 'delete',
  


  })


}

//修改角色
export const UpdateSysRole=(data)=>{

  return request({
    url: `${api_name}/updateSysRole`,
    method: 'put',
    data


  })


}

//保存角色
export const SaveSysRole=(data)=>{

  return request({
    url: `${api_name}/saveSysRole`,
    method: 'post',
    data


  })


}


// 获取角色分页列表
export const GetSysRoleListByPage = (pageNum,pageSize,queryDto) => {
  return request({
    url: `${api_name}/findByPage/${pageNum}/${pageSize}`,
    method: 'get',
    params:queryDto
  })
}


